﻿/***************************************************************************
    Tarih           Sürüm       Değişiklik          İşlem
    --------------------------------------------------------------------------
    2013.Kas        1           Mehmet A. ORAKCI  Oluşturuldu.

****************************************** mehmetakiforakci@gmail.com ****/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace RaporProj
{
    public class DataProviderFactory
    {
        public static IReportProvider CreateReportProvider()
        {
            if (HttpContext.Current.Session["ReportDataProvider"] == null)
                HttpContext.Current.Session["ReportDataProvider"] = new ReportDataProvider();
            return HttpContext.Current.Session["ReportDataProvider"] as ReportDataProvider;
        }

        public static ICategoryProvider CreateCategoryProvider()
        {
            if (HttpContext.Current.Session["ReportDataProvider"] == null)
                HttpContext.Current.Session["ReportDataProvider"] = new ReportDataProvider();
            return HttpContext.Current.Session["ReportDataProvider"] as ReportDataProvider;
        }

        public static SqlDataProvider CreateSqlDataProvider()
        {
            if (HttpContext.Current.Session["SqlDataProvider"] == null)
                HttpContext.Current.Session["SqlDataProvider"] = new SqlDataProvider();
            return HttpContext.Current.Session["SqlDataProvider"] as SqlDataProvider;
        }
    }
}